package com.cosmozhu.jface.helloworld;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author cosmo zhu
 * @date 2021/10/18
 */
@Component
public class HelloWorld {
    @PostConstruct
    public void init() {
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setText("Hello World!");
        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) display.sleep();
        }
        display.dispose();
    }
}
